import React, { useEffect, useState } from 'react';
import { useHistory } from 'ice';
import './index.less'

const Index: React.FC = (props) => {
  const history = useHistory();
  const [bg, setBg] = useState("bg1")

  useEffect(() => {
    console.log(props, history);
  }, [location.pathname]);

  return (
    <div className={'global-wrap'}>
      <span onClick={() => {
        history.push('/');
      }}
      >首页
      </span>
      <span onClick={() => {
        history.push('/login');
      }}
      >登录
      </span>
      <span onClick={() => {
        console.log(location);
      }}
      >打印一些信息
      </span>
      {props.children}
    </div>
  );
};

export default Index;
